


<!DOCTYPE html>
<html id="htmlId">
<head>
  <title>Coverage Report > GameFactory</title>
  <style type="text/css">
    @import "../../css/coverage.css";
    @import "../../css/idea.min.css";
  </style>
  <script type="text/javascript" src="../../js/highlight.min.js"></script>
  <script type="text/javascript" src="../../js/highlightjs-line-numbers.min.js"></script>
</head>

<body>
<div class="content">
<div class="breadCrumbs">
Current scope:     <a href="../../index.html">all classes</a>
    <span class="separator">|</span>
    <a href="../index.html">nl.tudelft.jpacman.game</a>
</div>

<h1>Coverage Summary for Class: GameFactory (nl.tudelft.jpacman.game)</h1>

<table class="coverageStats">
<tr>
  <th class="name">Class</th>
<th class="coverageStat 
">
  Class, %
</th>
<th class="coverageStat 
">
  Method, %
</th>
<th class="coverageStat 
">
  Line, %
</th>
</tr>
<tr>
  <td class="name">GameFactory</td>
<td class="coverageStat">
  <span class="percent">
    0%
  </span>
  <span class="absValue">
    (0/1)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    0%
  </span>
  <span class="absValue">
    (0/3)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    0%
  </span>
  <span class="absValue">
    (0/4)
  </span>
</td>
</tr>

</table>

<br/>
<br/>


<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package nl.tudelft.jpacman.game;
&nbsp;
&nbsp;import nl.tudelft.jpacman.level.Level;
&nbsp;import nl.tudelft.jpacman.level.PlayerFactory;
&nbsp;import nl.tudelft.jpacman.points.PointCalculator;
&nbsp;
&nbsp;/**
&nbsp; * Factory that provides Game objects.
&nbsp; *
&nbsp; * @author Jeroen Roosen 
&nbsp; */
&nbsp;public class GameFactory {
&nbsp;
&nbsp;    /**
&nbsp;     * The factory providing the player objects.
&nbsp;     */
&nbsp;    private final PlayerFactory playerFactory;
&nbsp;
&nbsp;    /**
&nbsp;     * Creates a new game factory.
&nbsp;     *
&nbsp;     * @param playerFactory
&nbsp;     *            The factory providing the player objects.
&nbsp;     */
<b class="nc">&nbsp;    public GameFactory(PlayerFactory playerFactory) {</b>
<b class="nc">&nbsp;        this.playerFactory = playerFactory;</b>
&nbsp;    }
&nbsp;
&nbsp;    /**
&nbsp;     * Creates a game for a single level with one player.
&nbsp;     *
&nbsp;     * @param level
&nbsp;     *            The level to create a game for.
&nbsp;     * @param pointCalculator
&nbsp;     *             The way to calculate points upon collisions.
&nbsp;     * @return A new single player game.
&nbsp;     */
&nbsp;    public Game createSinglePlayerGame(Level level, PointCalculator pointCalculator) {
<b class="nc">&nbsp;        return new SinglePlayerGame(playerFactory.createPacMan(), level, pointCalculator);</b>
&nbsp;    }
&nbsp;
&nbsp;    /**
&nbsp;     * Returns the player factory associated with this game factory.
&nbsp;     *
&nbsp;     * @return The player factory associated with this game factory.
&nbsp;     */
&nbsp;    protected PlayerFactory getPlayerFactory() {
<b class="nc">&nbsp;        return playerFactory;</b>
&nbsp;    }
&nbsp;}
</code>
</pre>
</div>

<script type="text/javascript">
(function() {
    var msie = false, msie9 = false;
    /*@cc_on
      msie = true;
      @if (@_jscript_version >= 9)
        msie9 = true;
      @end
    @*/

    if (!msie || msie && msie9) {
      hljs.highlightAll()
      hljs.initLineNumbersOnLoad();
    }
})();
</script>

<div class="footer">
    
    <div style="float:right;">generated on 2023-04-23 16:26</div>
</div>
</body>
</html>
